import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:imember/UI/Summary/SummaryCount.dart';
import 'package:imember/Util/Global.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Util/PageUtil.dart';
import 'package:imember/Widget/MyButton.dart';
import 'package:imember/Widget/MyInput.dart';
import 'package:imember/Widget/MyPage.dart';

class InputPsw extends StatefulWidget {
  static const int SummaryCount = 1;
  static const int MoneyBox = 2;
  int nextPage;

  InputPsw(this.nextPage);

  @override
  State<StatefulWidget> createState() {
    return InputPswState();
  }
}

class InputPswState extends State<InputPsw> {
  confirmClick() {
    if (widget.nextPage == InputPsw.SummaryCount) {
      PageUtil().openReplace(context, SummaryCount());
    }
  }

  @override
  Widget build(BuildContext context) {
    return MyPage(Container(
        alignment: Alignment.center,
        child: Column(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [
          Text("管理密碼", style: TextStyle(fontSize: 30, color: MyColor.Orange)),
          Container(
            width: 340,
            height: 44,
            decoration: Global.getBoxBg(25, MyColor.F2),
            margin: EdgeInsets.fromLTRB(0, 19, 0, 35),
            padding: EdgeInsets.fromLTRB(18, 0, 18, 0),
            child: NormalInput(hintText: "密碼", fontSize: 20, inputType: NormalInput.Password),
          ),
          OrangeBtn("確認", width: 106, height: 36, radius: 21, onTap: confirmClick)
        ])));
  }
}
